package com.xw.comm.entity.run;

/**
 * 基本的地理位置
 *
 * @author ：xiongwei
 * @date ：Created in 2021/9/25 21:25
 */
public enum BaseLocationEnum {

    /**
     * 天上、地下、普通、背景
     */
    HEAVENS("天上", 1),
    UNDERGROUND("地面之下", 2),
    ORDINARY("普通", 3),
    BACKGROUND("背景", 4);

    private String name;
    private int index;


    BaseLocationEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }


    public static String getBaseLocation(int index) {
        for (BaseLocationEnum location : BaseLocationEnum.values()) {
            if (location.getIndex() == index) {
                return location.getName();
            }
        }
        return ORDINARY.getName();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

}
